package com._23DesignPattern._create._builder._ex2;

/**
 * @Author: huangya
 * @Date: 2019/9/25
 * @Description:
 */
public class TestBuilder {

    public static void main(String[] str){

        Builder builder = new SonyBuilder();
        //导演持有builder的引用
        Director director = new Director(builder);


        director.construct("索尼摄像头", "1280x720像素", "4核因特尔CPU");
        Phone phone = builder.creat();
        System.out.println(phone.toString());


        director.construct("索尼摄像头");
        Phone phone2 = builder.creat();
        System.out.println(phone2.toString());


        director.construct();
        Phone phone3 = builder.creat();
        System.out.println(phone3.toString());

    }
}
